import os

DEBUG = True
SECRET_KEY = 'my precious'
BASE_DIR = os.path.abspath(os.path.dirname(__file__))
SQLALCHEMY_DATABASE_URI = 'sqlite:///' + os.path.join(BASE_DIR, 'database.db')
HOST = 'localhost'
PORT = int(os.environ.get('PORT', 5000))

# API 密钥配置
DEEPSEEK_API_KEY = os.environ.get('DEEPSEEK_API_KEY', '')
STABILITY_API_KEY = os.environ.get('STABILITY_API_KEY', '')

# JWT配置
JWT_SECRET_KEY = os.environ.get('JWT_SECRET_KEY', 'super-secret')
JWT_ACCESS_TOKEN_EXPIRES = 24 * 60 * 60  # 24小时过期

# 上传文件配置
UPLOAD_FOLDER = os.path.join(BASE_DIR, '..', '..', 'app', 'static', 'uploads')
if not os.path.exists(UPLOAD_FOLDER):
    os.makedirs(UPLOAD_FOLDER, exist_ok=True)

# 生成图片配置
IMAGE_GENERATION_PATH = os.path.join(BASE_DIR, '..', '..', 'app', 'static', 'images')
if not os.path.exists(IMAGE_GENERATION_PATH):
    os.makedirs(IMAGE_GENERATION_PATH, exist_ok=True)